/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include "cast_engine_log.h"
#include "dlna_player_listener.h"
#include "surface_utils.h"
#include "ui/rs_surface_node.h"
namespace OHOS {
namespace CastEngine {
namespace CastEngineService {
DEFINE_CAST_ENGINE_LABEL("Dlna-Player-Listener");

DlnaPlayerListener::DlnaPlayerListener(wptr<CastEngineDlnaService> castEngineDlnaService)
    :castEngineDlnaService_(castEngineDlnaService)
{

}


DlnaPlayerListener::~DlnaPlayerListener()
{

}

void DlnaPlayerListener::OnStateChanged(const PlayerStates playbackState, bool isPlayWhenReady)  
{
    CLOGI("OnStateChanged start %{public}d",static_cast<int>(playbackState));
    castEngineDlnaService_->OnStateChanged(playbackState);
}
void DlnaPlayerListener::OnPositionChanged(int position, int bufferPosition, int duration)   
{
    castEngineDlnaService_->OnPositionChanged(position,duration);
}
void DlnaPlayerListener::OnMediaItemChanged(const MediaInfo &mediaInfo)   
{
    CLOGI("OnMediaItemChanged start");
}
void DlnaPlayerListener::OnVolumeChanged(int volume, int maxVolume)   
{
    CLOGI("OnVolumeChanged start");
    castEngineDlnaService_->OnVolumeChanged(volume,maxVolume);
}
void DlnaPlayerListener::OnLoopModeChanged(const LoopMode loopMode)   
{
    CLOGI("OnLoopModeChanged start");
}
void DlnaPlayerListener::OnPlaySpeedChanged(const PlaybackSpeed speed)   
{
    CLOGI("OnPlaySpeedChanged start");
}
void DlnaPlayerListener::OnPlayerError(int errorCode, const std::string &errorMsg)   
{
    CLOGI("OnPlayerError start");
}
void DlnaPlayerListener::OnVideoSizeChanged(int width, int height)   
{
    CLOGI("OnVideoSizeChanged start");
}
void DlnaPlayerListener::OnNextRequest()   
{
    CLOGI("OnNextRequest start");
}
void DlnaPlayerListener::OnPreviousRequest()   
{
    CLOGI("OnPreviousRequest start");
}
void DlnaPlayerListener::OnSeekDone(int position)   
{
    CLOGI("OnSeekDone start");
    
}
void DlnaPlayerListener::OnEndOfDlna(int isLooping) 
{
    CLOGI("OnEndOfDlna start");
}
} // namespace CastEngineService
} // namespace CastEngine
} // namespace OHOS